import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const login = r => require.ensure([], () => r(require('@/page/login')), 'login');
const manage = r => require.ensure([], () => r(require('@/page/manage')), 'manage');

/**申请列表*/
const applicationManage = r => require.ensure([], () => r(require('@/page/applicationManage')), 'applicationManage');

/**业务系统*/
const businessManage = r => require.ensure([], () => r(require('@/page/businessManage')), 'businessManage');

/**业务系统菜单详情*/
const businessManageDetail = r => require.ensure([], () => r(require('@/page/businessManageDetail')), 'businessManageDetail');

const routes = [
	{
		path: '/',
		component: login
	}, {
		path: '/manage',
		component: manage,
		name: '',
		children: [
		    {
                path: '/applicationManage',
                component: applicationManage,
                meta: ['myApplication', 'applicationList'],
            }, {
                path: '/businessManage',
                component: businessManage,
                meta: ['sysManage', 'businessManage'],
            }, {
                path: '/businessManageDetail',
                component: businessManageDetail,
                meta: ['sysManage', 'businessManageDetail'],
            }
        ]
	}
]

export default new Router({
	routes,
	strict: process.env.NODE_ENV !== 'production',
})
